package com.cloud.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cloud.retry.entity.LogEntity;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface LogMapper extends BaseMapper<LogEntity> {
//    @Select("select * from log where id =#{id}")
//    LogEntity getLogById(@Param("id") Long id);
//
//    @Insert(" @Insert(\"INSERT INTO api_request (type, source_name, request_method, request_url, request_path, request_headers, request_time, crt_time, upd_time) \" +\n" +
//            "            \"VALUES (#{logEntity.type}, #{logEntity.sourceName}, #{logEntity.requestMethod}, #{logEntity.requestUrl}, #{logEntity.requestPath}, \" +\n" +
//            "            \"#{logEntity.requestHeaders}, #{logEntity.requestTime}, #{logEntity.crtTime}, #{logEntity.updTime})\"))")
//    void add(@Param("logEntity") LogEntity logEntity);
//
//    @Select("select * from log")
//    List<LogEntity> getList();
//
//    @Update({
//            "UPDATE api_request",
//            "SET type = #{apiRequest.type},",
//            "source_name = #{apiRequest.sourceName},",
//            "request_method = #{apiRequest.requestMethod},",
//            "request_url = #{apiRequest.requestUrl},",
//            "request_path = #{apiRequest.requestPath},",
//            "request_headers = #{apiRequest.requestHeaders},",
//            "request_time = #{apiRequest.requestTime},",
//            "crt_time = #{apiRequest.crtTime},",
//            "upd_time = #{apiRequest.updTime}",
//            "WHERE id = #{apiRequest.id}"
//    })
//    void updateApiRequest(@Param("apiRequest") LogEntity apiRequest);

}
